<?php
//here will be style functions


function main_category_start($category){
// this return styled main category in main menu
return '<p>'.
'<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center" class="user"><tr height="40px" class="category"><td  align="center">'.
'<h1>'.$category['name']."</h1></td></tr><br />";
}

function main_sub($category){
// this return styled sub category in main forum 
return '<tr height="40px"><td align="center"><h2> <a href="'.$site_url.'/forum/?category='.$category['uid'].'&authkey='.$_GET['authkey'].'">'.$category['name']."</a></h2></td></tr>";
}

function main_category_end($category){
// this return styled main category in main menu
return '</table></p><br />';
}

function topics($topic){

//return '<h2></h2>";
$ret='<tr height="40px">'.
'<td width="33%" align="center">'.'<a href="'.$site_url.'/forum/?topic='.$topic['uid'].'&authkey='.$_GET['authkey'].'">'.$topic['name']."</a>".'</td>
<td width="33%" align="center">'.user_profile($topic['author']).'</td>
<td width="33%" align="center">'.$topic['date'].'</td>'.
'</tr>';

return $ret;
;
}

function topics_start($top){
return '<br /><table cellspacing="0" cellpadding="0" border="0" width="100%" align="center" class="user">'.
'<tr height="40px" align="center">'.
'<td width="33%" align="center"> topic name </td>'.
'<td width="33%" align="center"> author name </td>'.
'<td width="33%" align="center"> touch date </td>'.
'</tr>';
}

function topics_end($top){
return '</table><br />';
}

function posts_start($top){
return "\n".'<p>'."\n";
}

function post($post){

global $site_users_arr,$site_user;

ob_start();
get_reg();
ob_end_clean();

if ((($post['author']==$site_user['name']) or (get_right($site_user['access'],3))) && isset($site_user)){
$editdel=' <a href="'.$site_url.'/forum/admin/edit.php?authkey='.$_GET['authkey'].'&post='.$post['pos'].'">Edit</a> '.
' <a href="'.$site_url.'/forum/admin/del.php?authkey='.$_GET['authkey'].'&post='.$post['pos'].'">REMOVE!</a> ';
}


/*$ret="\n".'<table cellspacing="2" cellpadding="2" border="1" align="center" width="600px">'."\n".
'<tr height="300px">'."\n".
''.
'    <td rowspan="2" width="160px" align="center" >'.
'<img src="'.getpic($site_users_arr[$post['author']]['avatar']).'" />'.
'<br />Name:'.user_profile($post['author']).
'<br />Access:'.$site_users_arr[$post['author']]['access'].
'</td>'."\n".
''.
'    <td align="center" width="440px">'.$post['text'].'</td>'."\n".
'</tr>'."\n".
'<tr height="30px">'."\n".
'    <td align="right" valign="bottom" width="440px"><small>'.$post['date'].$editdel.'</small></td>'."\n".
'</tr>'."\n".
'</table><br />'."\n"."\n";*/

$ret='<table cellspacing="0" cellpadding="0" border="0" align="center" width="620px">
<tr height="20px">
    <td width="20px" class="post_ul"></td>
    <td colspan="2" class="post_u"></td>
    <td width="20px" class="post_ur"></td>
</tr>
<tr height="300px">
    <td rowspan="2" width="10px" class="post_s"></td>
    <td rowspan="2" width="160px" align="center" class="post_au">'.
	'<img src="'.getpic($site_users_arr[$post['author']]['avatar']).'" />'.
'<br /><br /><div class="post_at">Name:'.user_profile($post['author']).
'<br />Access:'.$site_users_arr[$post['author']]['access'].
'</div></td>
    <td width="440px" align="center">'.$post['text'].'</td>'.
	'    <td rowspan="2" width="10px" class="post_s"></td>
</tr>
<tr>
    <td align="right"><small>'.$post['date'].$editdel.'</small></td>
</tr>
<tr>
    <td class="post_dl"></td>
    <td colspan="2" class="post_u"></td>
    <td class="post_dr"></td>
</tr>
</table><br />';




return $ret;
}

function posts_end($top){
return "\n".'</p>'."\n";
}

function getpic($pic){
// simply wrapper to show unset avatars
if ($pic=="" || !isset($pic)){
return $site_url.'/images/unset.jpg';
}else{
return $pic;
}
}

function users_start(){
return '<br /><table cellspacing="0" cellpadding="0" border="0" width="100%" class="user">'.
'<tr height="40px">
    <td align="center">name</td>
    <td align="center">icq</td>
    <td align="center">jabber</td>
    <td align="center">access</td>
</tr>';

}

function users_end(){
return '</table><br />';
}

function user($user){
return '<tr height="40px">
    <td align="center">'.user_profile($user['name']).'</td>
    <td align="center">'.$user['icq'].'</td>
    <td align="center">'.$user['jabber'].'</td>
    <td align="center">'.$user['access'].'</td>
</tr>';
}

function user_profile($name){

return '<a href="'.$site_url.'/t16cms/modules/user.php?name='.$name.'&authkey='.$_GET['authkey'].'">'.$name.'</a>';

}

function admins($text){



return '<table align="right" class="admin">
 <tr>
  <td align="center">
    '.$text.'
  </td>
 </tr>
</table>';
}

function pages_start(){
return '<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center" class="pages"><tr height="40px"><td align="center">';
}

function pages_end(){
return "</td></tr></table>";
}

function page($x,$bk){
return '<a href="'.$site_url.'/forum/?authkey='.$_GET['authkey'].'&'.$bk.'&page='.$x.'">'. $x."</a> ";
}
?>